<!doctype html>
<html class="no-js fixed-layout">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>首页</title>
  <meta name="description" content="index">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="/static/assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="/static/assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="/static/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="/static/assets/css/admin.css">
  <style type="text/css">
    .input_width{
      width: 90%;
    }
    .span_x{
      color: red;
    }
    .div_text{
      width: 20%;
      padding-right: 1.5rem;
      float: left;
      position: relative;
    }
  </style>
</head>
<body >



  <div class="admin-content">
    <div class="admin-content-body" style="background-color: #EBEBEB;">
      <div class="am-g" style="top: 0px;position: fixed;z-index:999">
        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #F8F8FF;margin: 1px auto;padding: 20px;">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs" >
              <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="back_to()">返回</button>
            </div>
          </div>
        </div>
      </div>
      <div class="am-g" style="width: 50%;min-width: 1000px;padding-bottom: 70px;padding-top: 70px;">
 
        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #FFFFFF;margin: 1px auto;padding: 20px;">
          <!--中间侧块 注意下面是form表-->
          <div class="am-form-group" style="width: 20%;float: left;font-size: 20px;padding-top: 20px;">
            <label ><strong>路线信息</strong></label>
          </div>
          <div class="am-form-group" style="width: 80%;float: right;font-size: 1.37rem;">

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">所属路线：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='line_id' name='line_id' class="input_width" onchange="line_id_change()">
                  {% for i in line %}
                  {% if i.id == xlist.0.line_id %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select>
              </div>
              <div class="div_text am-text-right">所属路段：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='section_id_0' name='section_id_0' class="input_width" style="display: none;" >
                  {% for i in section %}
                  <option value={{ i.id }} name=line_id_{{ i.lineId }} >{{ i.name }}</option>
                  {% endfor %}

                </select>
                <select  id='section_id' name='section_id' class="input_width" >
                  {% for i in section %}
                  {% if i.lineId == xlist.0.line_id %}
                  {% if i.id == xlist.0.section_id %}
                  <option value={{ i.id }} name=line_id_{{ i.lineId }} selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }} name=line_id_{{ i.lineId }} >{{ i.name }}</option>
                  {% endif %} 
                  {% else %}
                  <option value={{ i.id }} name=line_id_{{ i.lineId }} style="display: none;">{{ i.name }}</option>
                  {% endif %} 
                  {% endfor %}

                </select>
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">路线等级：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_line_level' name='param_line_level' class="input_width" >
                  {% for i in lineLevel %}
                  {% if i.id == xlist.0.param_line_level %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
                      
              </div>
            </div>

          </div>

        </div>  
        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #FFFFFF;margin: 1px auto;padding: 20px;">
          <!--中间侧块 注意下面是form表-->
          
          <div class="am-form-group" style="width: 20%;float: left;font-size: 20px;padding-top: 20px;">
            <label ><strong>基本信息</strong></label>
          </div>
          <div class="am-form-group" style="width: 80%;float: right;font-size: 1.37rem;">

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right"><span class="span_x">*</span>桥梁名称：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width" id="bridge_name" maxlength="100"  value="{{ xlist.0.bridge_name }}">
              </div>
              <div class="div_text am-text-right"><span class="span_x">*</span>桥梁编号：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width" id="bridge_code"  maxlength="100"  value="{{ xlist.0.bridge_code }}">     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">类别：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='bridgecategory' name='bridgecategory' class="input_width" >
                  {% for i in bridgecategory %}
                  {% if i.id == xlist.0.param_bridge_category %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
              </div>
              <div class="div_text am-text-right">桥位桩号：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="pile_no"  maxlength="100"  value="{{ xlist.0.pile_no }}">     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">功能类型：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_func_type' name='param_func_type' class="input_width" >
                  {% for i in funcType %}
                  {% if i.id == xlist.0.param_func_type %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
              </div>
              <div class="div_text am-text-right">下穿道名：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="under_cross_road"  maxlength="100" value="{{ xlist.0.under_cross_road }}">     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">下穿道桩号：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="under_cross_road_no" maxlength="100"  value="{{ xlist.0.under_cross_road_no }}">
              </div>
              <div class="div_text am-text-right">设计载荷：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_design_load' name='param_design_load' class="input_width" > 
                  {% for i in designLoad %}
                  {% if i.id == xlist.0.param_design_load %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">通行载重(t)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="run_load"  maxlength="100" value="{{ xlist.0.run_load }}">
              </div>
              <div class="div_text am-text-right">桥梁纵坡(%)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="bridge_longitudinal_slope" maxlength="100"  value="{{ xlist.0.bridge_longitudinal_slope }}">     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥梁横坡(%)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="bridge_cross_slope" maxlength="100"  value="{{ xlist.0.bridge_cross_slope }}">     
              </div>
              <div class="div_text am-text-right">桥长(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="length" maxlength="100"  value="{{ xlist.0.length }}">
              </div>
              
            </div>
            
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥面总宽(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="bridge_total_width" maxlength="100"  value="{{ xlist.0.bridge_total_width }}">     
              </div>
              <div class="div_text am-text-right">车行道宽(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="driveway_width"  maxlength="100" value="{{ xlist.0.driveway_width }}">
              </div>
            </div>
            
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥面标高(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="deck_elevation" maxlength="100" value="{{ xlist.0.deck_elevation }}">     
              </div>
              <div class="div_text am-text-right">桥下净高(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="under_height" maxlength="100"  value="{{ xlist.0.under_height }}">     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">引道总宽(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="approach_width"  maxlength="100" value="{{ xlist.0.approach_width }}">
              </div>
              <div class="div_text am-text-right">引道路面宽(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="approach_road_width" maxlength="100"  value="{{ xlist.0.approach_road_width }}">     
              </div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">引道线形：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='approach_linear' name='approach_linear' class="input_width"  >
                  {% for i in approachAlignment %}
                  {% if i.id == xlist.0.approach_linear %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
              </div>
              <div class="div_text am-text-right">交角(°)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="angle" maxlength="100"  value="{{ xlist.0.angle }}">     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">总跨数：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="span_total"  maxlength="100" value="{{ xlist.0.span_total }}">
              </div>
              <div class="div_text am-text-right">中央隔离带(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="central_isolation_belt" maxlength="100" value="{{ xlist.0.central_isolation_belt }}">
              </div>
              <!-- <div class="div_text am-text-right">路面净宽(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="deck_width"  maxlength="100" value="{{ xlist.0.deck_width }}">     
              </div> -->
              <!-- <div class="div_text am-text-right">跨越情况说明：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="cross_situation_explain"  maxlength="100" value="{{ xlist.0.cross_situation_explain }}">     
              </div> -->
            </div>


            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">建设年限：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="date"  class="am-input-xl  input_width"  id="build_date"  value="{{ xlist.0.build_date }}">
              </div>
              <div class="div_text am-text-right">支座类型：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_support_type' name='param_support_type'  class="input_width" >

                  {% for i in supportType %}
                  {% if i.id == xlist.0.param_support_type %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>     
              </div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥塔结构形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_tower_structure_form' class="input_width" >
                  {% for i in towerStructureForm %}
                  {% if i.id == xlist.0.param_tower_structure_form %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select> 
              </div>
              <div class="div_text am-text-right">桥塔材料：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_tower_material'  class="input_width" >
                  {% for i in towerMaterial %}
                  {% if i.id == xlist.0.param_tower_material %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select>     
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥上净高(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="bridge_clear_height" maxlength="100" value="{{ xlist.0.bridge_clear_height }}">
              </div>
              <div class="div_text am-text-right">地震动峰值加速度系数：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="earthquake_pac" maxlength="100" value="{{ xlist.0.earthquake_pac }}">
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥台护坡：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="abutment_slope_protection" maxlength="100" value="{{ xlist.0.abutment_slope_protection }}">
              </div>
              <div class="div_text am-text-right">护墩体：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="pier_body" maxlength="100" value="{{ xlist.0.pier_body }}">
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">调制构造物：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="modulation_structure" maxlength="100" value="{{ xlist.0.modulation_structure }}">
              </div>
              <div class="div_text am-text-right">常水位(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="water_level" maxlength="100" value="{{ xlist.0.water_level }}">  
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">设计水位(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="design_water_level" maxlength="100" value="{{ xlist.0.design_water_level }}">
              </div>
              <div class="div_text am-text-right">历史洪水位(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="historical_flood_level" maxlength="100" value="{{ xlist.0.historical_flood_level }}">  
              </div>
            </div>

          </div>
          
        </div>



        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #FFFFFF;margin: 1px auto;padding: 20px;" id="part_add_div">
          <!--中间侧块 注意下面是form表-->
          <div class="am-form-group" style="width: 20%;float: left;font-size: 20px;padding-top: 20px;">
            <label ><strong>上部结构</strong></label>
          </div>
          <div class="am-form-group" style="width: 80%;float: right;font-size: 1.37rem;">
            <div class="am-g am-margin-top am-form-group">
              <button style="margin: 0 25px" type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="part_add({{ xlist.0.bridge_id }})" id="part_add_b" value=1>新增上部构件</button>
            </div>
            <div class="am-g am-margin-top am-form-group display_none" name="part_add_i">
              <div class="div_text am-text-right">项目序号：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  maxlength="100"  id="upper_order">
              </div>
              <div class="div_text am-text-right">项目跨数：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width"  maxlength="100"  id="span_number">
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group display_none" name="part_add_i">
              <div class="div_text am-text-right">跨径布置(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  maxlength="100"  id="span_arrangement">
              </div>
              <div class="div_text am-text-right">桥型：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_bridge_type' name='param_bridge_type' class="input_width" >
                  {% for i in bridgetype %}

                  <option  value={{ i.id }} >{{ i.name }}</option>

                  {% endfor %}  

                </select>
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group display_none" name="part_add_i">
              <div class="div_text am-text-right" >上部结构受力形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_force_form' name='param_force_form' class="input_width" >
                  {% for i in upperForceForm %}

                  <option  value={{ i.id }} >{{ i.name }}</option>

                  {% endfor %}  
                </select>
              </div>
              <div class="div_text am-text-right">上部结构形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_form' name='param_form' class="input_width" >
                  {% for i in upperStructureForm %}

                  <option  value={{ i.id }} >{{ i.name }}</option>

                  {% endfor %}  
                </select>
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group display_none" name="part_add_i">
              <div class="div_text am-text-right">上部结构材料：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_material' name='param_material' class="input_width" >
                  {% for i in upperMaterial %}

                  <option  value={{ i.id }} >{{ i.name }}</option>

                  {% endfor %}  
                </select>
              </div>
              <div class="div_text am-text-right">桥面板位：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_deck_board_position' name='param_deck_board_position' class="input_width" >
                  {% for i in deckboardposition %}

                  <option  value={{ i.id }} >{{ i.name }}</option>

                  {% endfor %}  
                </select>
                      
              </div>
            </div>
            <div>
              <table id="grid" class="am-table am-table-striped am-table-hover table-main am-table-compact am-text-nowrap" >
                <thead>
                <tr>
                <th class="table-title">项目序号</th>
                <th class="table-title">项目跨数</th>
                <th class="table-title">跨径布置(m)</th>
                <th class="table-title">桥面板位</th>
                <th class="table-title">上部结构受力形式</th>
                <th class="table-title">上部结构形式</th>
                <th class="table-title">上部结构材料</th>
                <th class="table-title">桥型</th>
                <th class="table-title">操作</th>
                </tr>
              </thead>
                <tbody id="part_add_table">
                  {% for i in uplist %}
                    <tr class="odd" id=part_add_table_tr_{{ i.upperpart_id }}>
                    <td class="sorting_1" >{{ i.upper_order }}</td>
                    <td class="sorting_1" align="">{{ i.span_number }}</td>
                    <td class="sorting_1" align="">{{ i.span_arrangement }}</td>
                    <td class="sorting_1" align="">{{ i.param_deck_board_position }}</td>
                    <td class="sorting_1" align="">{{ i.param_force_form }}</td>
                    <td class="sorting_1" align="">{{ i.param_form }}</td>
                    <td class="sorting_1" align="">{{ i.param_material }}</td>
                    <td class="sorting_1 param_bridge_type" attr1="{{ i.param_bridge_type_id }}">{{ i.param_bridge_type }}</td>
                    <td >
                      <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                          <button class="am-btn am-btn-default am-btn-xs am-text-secondary button_click" onclick="xm_delect({{ i.upperpart_id }})">删除</button>
                        </div>
                      </div>
                    </td>
                    </tr>
                  {% endfor %}
                </tbody>
              </table>
            </div>

            

          </div>

        </div>
        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #FFFFFF;margin: 1px auto;padding: 20px;">
          <!--中间侧块 注意下面是form表-->
          
          <div class="am-form-group" style="width: 20%;float: left;font-size: 20px;padding-top: 20px;">
            <label ><strong>下部结构</strong></label>
          </div>
          <div class="am-form-group" style="width: 80%;float: right;font-size: 1.37rem;">

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥墩形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_pier_style' name='param_pier_style'  class="input_width">
                  {% for i in pierStyle %}
                  {% if i.id == xlist.0.param_pier_style %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
              </div>
              <div class="div_text am-text-right">桥墩材料：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_pier_material' name='param_pier_material' class="input_width" >
                  {% for i in material %}
                  {% if i.id == xlist.0.param_pier_material %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select>
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥墩基础形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_pier_base_form' name='param_pier_base_form' class="input_width" >
                  {% for i in form %}
                  {% if i.id == xlist.0.param_pier_base_form %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
              </div>
              <div class="div_text am-text-right">桥台形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_abutment_style' name='param_abutment_style' class="input_width" > 
                  {% for i in abutmentStyle %}
                  {% if i.id == xlist.0.param_abutment_style %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥台材料：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_abutment_material' name='param_abutment_material' class="input_width" > 
                  {% for i in material %}
                  {% if i.id == xlist.0.param_abutment_material %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %} 
                </select>
              </div>
              <div class="div_text am-text-right">桥台基础形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_abutment_base_form' name='param_abutment_base_form' class="input_width" >
                  {% for i in form %}
                  {% if i.id == xlist.0.param_abutment_base_form %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select>
                      
              </div>


            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥塔基础材料：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_tower_basis_material'  class="input_width" >
                  {% for i in  towerBasisMaterial %}
                  {% if i.id == xlist.0.param_tower_basis_material %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select>
              </div>
              <div class="div_text am-text-right">桥塔基础形式：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_tower_base_form' class="input_width" >
                  {% for i in form %}
                  {% if i.id == xlist.0.param_tower_base_form %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}
                  {% endfor %}  
                </select>
                      
              </div>
            </div>

            <!-- <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">项目墩号：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width"  id="under_pier_number"  maxlength="100" value="{{ xlist.0.under_pier_number }}">
              </div>
              <div class="div_text am-text-right">项目台号：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width"  id="under_abutment_number"  maxlength="100" value="{{ xlist.0.under_abutment_number }}">
                      
              </div>
            </div> -->

          </div>
        </div>



        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #FFFFFF;margin: 1px auto;padding: 20px;" >
          <!--中间侧块 注意下面是form表-->
          
          <div class="am-form-group" style="width: 20%;float: left;font-size: 20px;padding-top: 20px;">
            <label ><strong>桥面系</strong></label>
          </div>
          <div class="am-form-group" style="width: 80%;float: right;font-size: 1.37rem;">

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">桥面铺装：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <select  id='param_deck_pavement' name='param_deck_pavement' class="input_width" >
                  {% for i in deckPavement %}
                  {% if i.id == xlist.0.param_deck_pavement %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}  
                </select>
              </div>
              <div class="div_text am-text-right">伸缩缝类型：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_expansion_type' name='param_expansion_type' class="input_width" >  
                  {% for i in expJoint %}
                  {% if i.id == xlist.0.param_expansion_type %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">左侧防护设施：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_left_facilities' name='param_left_facilities' class="input_width" >
                  {% for i in facilities %}
                  {% if i.id == xlist.0.param_left_facilities %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %} 
                </select>
                      
              </div>
              <div class="div_text am-text-right">右侧防护设施：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <select  id='param_right_facilities' name='param_right_facilities' class="input_width" >  
                  {% for i in facilities %}
                  {% if i.id == xlist.0.param_right_facilities %}
                  <option value={{ i.id }}  selected="selected">{{ i.name }}</option>
                  {% else %}
                  <option value={{ i.id }}  >{{ i.name }}</option>
                  {% endif %}  
                  {% endfor %}
                </select>
                      
              </div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">左侧防护设施宽度(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width"  id="left_facilities_width" maxlength="100"  value="{{ xlist.0.left_facilities_width }}" >
                      
              </div>
              <div class="div_text am-text-right">右侧防护设施宽度(m)：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width"  id="right_facilities_width" maxlength="100"  value="{{ xlist.0.right_facilities_width }}">
                      
              </div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">伸缩缝位置：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width"  id="expansion_position"  maxlength="100" value="{{ xlist.0.expansion_position }}" >
                      
              </div>
              
            </div>

          </div>

        </div>

        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #FFFFFF;margin: 1px auto;padding: 20px;">
          <!--中间侧块 注意下面是form表-->
          
          <div class="am-form-group" style="width: 20%;float: left;font-size: 20px;padding-top: 20px;">
            <label ><strong>单位信息</strong></label>
          </div>
          <div class="am-form-group" style="width: 80%;float: right;font-size: 1.37rem;">

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">建设单位：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">
                <input type="text"  class="am-input-xl  input_width" id="construction_depart"  maxlength="100" value="{{ xlist.0.construction_depart }}">
              </div>
              <div class="div_text am-text-right">设计单位：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width" id="design_depart"  maxlength="100"  value="{{ xlist.0.design_depart }}">
                      
              </div>
            </div>

            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">养护单位：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width" id="maintenance_depart"  maxlength="100"  value="{{ xlist.0.maintenance_depart }}">
                      
              </div>
              <div class="div_text am-text-right">施工单位：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width"  id="build_depart"  maxlength="100" value="{{ xlist.0.build_depart }}">
                      
              </div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="div_text am-text-right">备注：</div>
              <div class="am-u-md-3 am-u-end" style="padding-left: 0px;">

                <input type="text"  class="am-input-xl  input_width" id="remark" maxlength="100"  value="{{ xlist.0.remark }}">
                      
              </div>
              
            </div>

          </div>

        </div>

      </div>
       
      <div class="am-g" style="bottom: 0px;position: fixed;">
        <div class="am-u-sm-12 am-u-md-12 " style="background-color: #F8F8FF;margin: 1px auto;padding: 20px;">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs" style="margin: 0 50%;">

              <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="modify_submit({{ xlist.0.bridge_id }})">保存</button>


            </div>
          </div>

          
          

        </div>

      </div>
    </div>
    
  </div>



<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/static/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/static/assets/js/amazeui.min.js"></script>
<script src="/static/assets/js/amazeui.tree.js"></script>
<script src="/static/assets/datatables/amazeui.datatables.min.js"></script>
<script src="/static/assets/dialog/amazeui.dialog.min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/css/amazeui.tree.css" />
<script type="text/javascript" src="/static/assets/js/layer.js"></script>
<script src="/static/assets/js/app.js"></script>
<script type="text/javascript">
$.ajaxSetup({
  data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
});


  $(document).ready(function(){
    unable_bridge();
  })

  function unable_bridge(){

    var aaa = $("#part_add_table tr").find(".param_bridge_type");
    if($(aaa[0]).attr("attr1") != undefined){
      $("#param_bridge_type option[value="+$(aaa[0]).attr("attr1")+"]").attr("selected","selected");
      $("#param_bridge_type").attr("disabled",true);
    }else{
      $("#param_bridge_type").attr("disabled",false);
    }
    // var ccc = aaa[0].text()
    // console.log($(aaa[0]).attr("attr1"));
  }









  function line_id_change(){
    var line_id = $('#line_id option:selected').val();
    $('#section_id').empty();
    $('#section_id').append($('#section_id_0 option[name^=line_id_'+line_id+']').clone()); 
  }

  function back_to(){
    window.history.back(-1);
  }

  function part_add(bridge_id){
    var value = $('#part_add_b').val();
    console.log(value)
    if(value == 1){
      $("#part_add_b").html("保存");
      $("#part_add_b").val(2);
      $("div[name^=part_add]").removeClass("display_none")
    }else if(value = 2){
      
      part_add_up(bridge_id)
    }

  }


  function part_add_up(bridge_id){
    var upper_order = $('#upper_order').val();
    var span_number = $('#span_number').val();
    var span_arrangement = $('#span_arrangement').val();
    var param_bridge_type = $('#param_bridge_type option:selected').val();
    var param_force_form = $('#param_force_form option:selected').val();
    var param_form = $('#param_form option:selected').val();
    var param_material = $('#param_material option:selected').val();
    var param_deck_board_position = $('#param_deck_board_position option:selected').val();



      $.ajax({
          "url": "/QLXJ_QLLB_UpperSave/",
          "data":{"upper_order":upper_order,"span_number":span_number,"span_arrangement":span_arrangement,"param_bridge_type":param_bridge_type,"param_force_form":param_force_form,"param_form":param_form,"param_material":param_material,"param_deck_board_position":param_deck_board_position,"bridge_id":bridge_id},
          "datatype": "json",
          "type": "post",
          "async": "false"
        }).success(function(data) {
          if(data.status == 1) {
            //AlertMSG(data.message)
            message_layer(data.message)
            $("#part_add_b").html("新增上部构件");
            $("#part_add_b").val(1);
            $("div[name^=part_add]").addClass("display_none");
            part_present(data.data)
          } else {
            AlertMSG(data.message)
          }
        }).error(function(data) {
          AlertMSG("删除失败！")
        });



  }

// message_layer(data.message)
function message_layer(message){
    layer.msg(message, {
    time: 2000 //2秒关闭（如果不配置，默认是3秒）
  }); 
}


  function part_present(data){
    $("#part_add_table").empty()
    for(var i=0; i<data.length;i++){
      $("#part_add_table").append('<tr class="odd" id=part_add_table_tr_'+data[i].upperpart_id+'><td class="sorting_1" >'+data[i].upper_order+'</td><td class="sorting_1" align="">'+data[i].span_number+'</td><td class="sorting_1" align="">'+data[i].span_arrangement+'</td><td class="sorting_1" align="">'+data[i].param_deck_board_position+'</td><td class="sorting_1" align="">'+data[i].param_force_form+'</td><td class="sorting_1" align="">'+data[i].param_form+'</td><td class="sorting_1" align="">'+data[i].param_material+'</td><td class="sorting_1 param_bridge_type" attr1="'+data[i].param_bridge_type_id+'">'+data[i].param_bridge_type+'</td>  <td ><div class="am-btn-toolbar"> <div class="am-btn-group am-btn-group-xs"> <button class="am-btn am-btn-default am-btn-xs am-text-secondary button_click" onclick="xm_delect('+data[i].upperpart_id+')">删除</button></div> </div></td></tr>');
    }

    unable_bridge();
    //console.log(data)

  }


  function xm_delect(upperpart_id){
    AMUI.dialog.confirm({
      title: '删除确认',
      content: '您确认删除该上部结构?',
      onConfirm: function() {
        $.ajax({
          "url": "/QLXJ_QLLB_UpperDel/?upperpart_id=" + upperpart_id + "",
          "datatype": "json",
          "type": "get",
          "async": "false"
        }).success(function(data) {
          if(data.status == 1) {
            message_layer(data.message)
            $("#part_add_table_tr_"+upperpart_id).remove();
            unable_bridge();
          } else {
            AlertMSG(data.message)
          }
        }).error(function(data) {
          AlertMSG("删除失败！")
        });
      },
      onCancel: function() {
        console.log('onCancel')
      }
    });
  }

function modify_submit(bridge_id){
 
  var line_id = $('#line_id option:selected').val();var line_name = $('#line_id option:selected').text()

  var section_id = $('#section_id option:selected').val();var section_name = $('#section_id option:selected').text()
  var param_line_level = $('#param_line_level option:selected').val();

  var bridge_name = document.getElementById("bridge_name").value;
  var bridge_code = document.getElementById("bridge_code").value;
  var bridgecategory = $('#bridgecategory option:selected').val();
  var pile_no = document.getElementById("pile_no").value;
  var param_func_type = $('#param_func_type option:selected').val();
  var under_cross_road = document.getElementById("under_cross_road").value;
  var under_cross_road_no = document.getElementById("under_cross_road_no").value;
  var param_design_load = document.getElementById("param_design_load").value;
  var run_load = document.getElementById("run_load").value;
  var bridge_longitudinal_slope = document.getElementById("bridge_longitudinal_slope").value;
  var bridge_cross_slope = document.getElementById("bridge_cross_slope").value;
  var length = document.getElementById("length").value;
  var bridge_total_width = document.getElementById("bridge_total_width").value;
  var driveway_width = document.getElementById("driveway_width").value;
  var deck_elevation = document.getElementById("deck_elevation").value;
  var under_height = document.getElementById("under_height").value;
  var approach_width = document.getElementById("approach_width").value;
  var approach_road_width = document.getElementById("approach_road_width").value;
  var approach_linear = $('#approach_linear option:selected').val();
  var angle = document.getElementById("angle").value;
  var span_total = document.getElementById("span_total").value;
  // var deck_width = document.getElementById("deck_width").value;
  var central_isolation_belt = document.getElementById("central_isolation_belt").value;
  // var cross_situation_explain = document.getElementById("cross_situation_explain").value;
  var build_date = document.getElementById("build_date").value;
  var param_support_type = $('#param_support_type option:selected').val();

  var param_tower_structure_form = $('#param_tower_structure_form option:selected').val();
  var param_tower_material = $('#param_tower_material option:selected').val();
  var bridge_clear_height = $('#bridge_clear_height').val();
  var earthquake_pac = $('#earthquake_pac').val();
  var abutment_slope_protection = $('#abutment_slope_protection').val();
  var pier_body = $('#pier_body').val();
  var modulation_structure = $('#modulation_structure').val();
  var water_level = $('#water_level').val();
  var design_water_level = $('#design_water_level').val();
  var historical_flood_level = $('#historical_flood_level').val();



  var param_pier_style = $('#param_pier_style option:selected').val();
  var param_pier_material = $('#param_pier_material option:selected').val();
  var param_pier_base_form = $('#param_pier_base_form option:selected').val();
  var param_abutment_style = $('#param_abutment_style option:selected').val();
  var param_abutment_material = $('#param_abutment_material option:selected').val();
  var param_abutment_base_form = $('#param_abutment_base_form option:selected').val();
  // var under_pier_number = document.getElementById("under_pier_number").value;
  // var under_abutment_number = document.getElementById("under_abutment_number").value;

  var param_tower_basis_material = $('#param_tower_basis_material option:selected').val();
  var param_tower_base_form = $('#param_tower_base_form option:selected').val();


  var param_deck_pavement = $('#param_deck_pavement option:selected').val();
  var param_expansion_type = $('#param_expansion_type option:selected').val();
  var param_left_facilities = $('#param_left_facilities option:selected').val();
  var param_right_facilities = $('#param_right_facilities option:selected').val();
  var left_facilities_width = document.getElementById("left_facilities_width").value;
  var right_facilities_width = document.getElementById("right_facilities_width").value;
  var expansion_position = document.getElementById("expansion_position").value;

  var construction_depart = document.getElementById("construction_depart").value;
  var design_depart = document.getElementById("design_depart").value;
  var maintenance_depart = document.getElementById("maintenance_depart").value;
  var build_depart = document.getElementById("build_depart").value;
  var remark = document.getElementById("remark").value;

  if(bridge_name==''){
    AlertMSG("请填写桥梁名称！")
  }else if (bridge_code==''){
    AlertMSG("请填写桥梁编号！")
  }else {

    $.ajax({
      "url":"/QLXJ_QLLB_basicSave/",
      "data":{"line_id":line_id,"line_name":line_name,"section_id":section_id,"section_name":section_name,"param_line_level":param_line_level,"bridge_name":bridge_name,"bridge_code":bridge_code,"bridgecategory":bridgecategory,"pile_no":pile_no,"param_func_type":param_func_type,"under_cross_road":under_cross_road,"under_cross_road_no":under_cross_road_no,"param_design_load":param_design_load,"run_load":run_load,"bridge_longitudinal_slope":bridge_longitudinal_slope,"bridge_cross_slope":bridge_cross_slope,"length":length, "bridge_total_width":bridge_total_width,"driveway_width":driveway_width,"deck_elevation":deck_elevation,  "under_height":under_height,"approach_width":approach_width, "approach_road_width":approach_road_width,"approach_linear":approach_linear, "angle":angle,"span_total":span_total, "central_isolation_belt":central_isolation_belt,"build_date":build_date,"param_support_type":param_support_type,   "param_tower_structure_form":param_tower_structure_form,"param_tower_material":param_tower_material,"bridge_clear_height":bridge_clear_height,"earthquake_pac":earthquake_pac,"abutment_slope_protection":abutment_slope_protection,"pier_body":pier_body,"modulation_structure":modulation_structure,"water_level":water_level,"design_water_level":design_water_level,"historical_flood_level":historical_flood_level,   "param_pier_style":param_pier_style, "param_pier_material":param_pier_material,"param_pier_base_form":param_pier_base_form, "param_abutment_style":param_abutment_style,"param_abutment_material":param_abutment_material,  "param_abutment_base_form":param_abutment_base_form,    "param_tower_basis_material":param_tower_basis_material,"param_tower_base_form":param_tower_base_form,   "param_deck_pavement":param_deck_pavement, "param_expansion_type":param_expansion_type,"param_left_facilities":param_left_facilities,  "param_right_facilities":param_right_facilities,"left_facilities_width":left_facilities_width,"right_facilities_width":right_facilities_width,"expansion_position":expansion_position, "construction_depart":construction_depart,"design_depart":design_depart,"maintenance_depart":maintenance_depart,"build_depart":build_depart,"remark":remark,"bridge_id":bridge_id},
      "datatype":"json",
      "type":"post",
      "async":"false"
    }).success(function(data){
      if (data.status == 1) {
        //var index = parent.layer.getFrameIndex(window.name);
        //parent.location.reload();
        //parent.layer.close(index);
        //console.log(data.data)
        // AlertMSG_S(data.message)
        message_layer(data.message)
        back_to()

      } else {
        AlertMSG(data.message)
      }
    }).error(function(data){
      AlertMSG("保存失败！")
    });
  }
}


var AlertMSG=function(msg){
    AMUI.dialog.alert({ title: '错误提示', content: msg, onConfirm: function() { console.log('close'); } });
}

var AlertMSG_S=function(msg){
    AMUI.dialog.alert({ title: '成功提示', content: msg, onConfirm: function() { console.log('close'); } });
}
</script>
<style type="text/css">
  .display_none{
    display: none;
  }
</style>
</body>

</html>